package org.keyyond.ms.scheduler.jobs;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.keyyond.ms.scheduler.service.MsEsbFeiYunSyncService;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@DisallowConcurrentExecution //非并发执行
public class DeptSyncFyJob implements BaseJob{
	
	@Autowired
	private MsEsbFeiYunSyncService feiYunSyncService;

	@Override
	public void execute(JobExecutionContext context)
			throws JobExecutionException {
		// TODO Auto-generated method stub
		try {
			SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
			Date date = new Date();
			System.out.println(simpleDateFormat.format(date)+"++++++++++++++++++++++++++++++++++++++++++++++");
			String result = feiYunSyncService.deptSyncFeiYun();
			System.out.println(result);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		  System.out.println("deptSyncFeiYun!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
		
	}

}
